//--------------------------------------------------------------
//
// Qizhi Zhang 
// ezhung@gmail.com
// http://www.moorwind.com
//
//--------------------------------------------------------------
package reader.dao
{
	import reader.core.ReaderError;
	
	public class DAOFactory
	{
		//////////////////////////////////////////////////////////////////////////////
		//Public properties
		
		// List of DAO types supported by the factory
		public static const SQLITE:int = 1;
		
		// There will be a method for each DAO that can be created. The concrete factories will have to implement these methods.
		public function get accountDAO():IAccountDAO
		{
			throw new ReaderError(ReaderError.ABSTRACT_ERROR);
		}
		public function get labelDAO():ILabelDAO
		{
			throw new ReaderError(ReaderError.ABSTRACT_ERROR);
		}
		
		public function get blogSourceDAO():IBlogSourceDAO
		{
			throw new ReaderError(ReaderError.ABSTRACT_ERROR);
		}
		
		public function get blogDAO():IBlogDAO
		{
			throw new ReaderError(ReaderError.ABSTRACT_ERROR);
		}
		
		public function get serviceDAO():IServiceDAO
		{
			throw new ReaderError(ReaderError.ABSTRACT_ERROR);
		}
		
		public function get draftDAO():IDraftDAO
		{
			throw new ReaderError(ReaderError.ABSTRACT_ERROR);
		}
		
		public function get mediaDAO():IMediaDAO
		{
			throw new ReaderError(ReaderError.ABSTRACT_ERROR);
		}
		//////////////////////////////////////////////////////////////////////////////
		//methods
		
		public static function getDAOFactory(whichFactory:int):DAOFactory
		{
			switch (whichFactory) 
			{
				case SQLITE:
					return new SqliteDAOFactory();
				default :
					return null;
			}
		}

	}
}